package com.jason.library.network.utils;

import android.app.Application;

import com.jason.library.network.ui.NetworkManager;

/**
 * Description:NetworkTool
 *
 * @author chenbaoyang
 * @create 2020/12/14 15:20
 */
public class NetworkTool {

    private static NetworkTool INSTANCE;
    private Application app;

    /**
     * 获取NetworkTool实例 ,单例模式
     */
    public static NetworkTool getInstance() {
        if (INSTANCE == null) {
            synchronized (NetworkTool.class) {
                if (INSTANCE == null) {
                    INSTANCE = new NetworkTool();
                }
            }
        }
        return INSTANCE;
    }

    public void init(Application application){
        this.app = application;
        //setOkHttpHook();
        NetworkManager.get().startMonitor();
    }


    public Application getApplication() {
        return app;
    }


}
